package com.bondex.charter.maindata.service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bondex.charter.maindata.pojo.api.*;
import com.bondex.charter.maindata.pojo.dto.*;
import com.bondex.global.commons.GlobalConst;
import com.bondex.global.pojo.JsonDataT;
import com.bondex.global.pojo.TransmissionHead;
import com.bondex.global.pojo.TransmissionModel;
import com.bondex.global.utils.DateUtil;
import com.bondex.global.utils.HttpConnectUtil;
import com.bondex.global.utils.JacksonUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * 主数据查询类
 * Created by JD on 2021/04/12.
 */
public class MainDataService {

    public MainDataService(String sURL) {
        this.m_URL = sURL;
        resetURL();
    }

    public MainDataService(String sURL, String sFrameworkAppID, String sFrameworkAppName) {
        this.m_URL = sURL;
        this.frameworkAppID = sFrameworkAppID;
        this.frameworkAppName = sFrameworkAppName;
        resetURL();
    }


    //region 共通
    private String m_URL;

    private String m_URL_COM_DICTIONARY;//字典 http://mdd.bondex.com.cn:9085/maindata/api/com/dictionary
    private String m_URL_COM_COUNTRY;//国家  http://mdd.bondex.com.cn:9085/maindata/api/com/country
    private String m_URL_COM_CN_DISTRICT;//省市区  http://mdd.bondex.com.cn:9085/maindata/api/com/cnDistrict
    private String m_URL_COM_FN_DISTRICT;//外国省市区  http://mdd.bondex.com.cn:9085/maindata/api/com/fnDistrict
    private String m_URL_COM_HOLIDAY;//假日  http://mdd.bondex.com.cn:9085/maindata/api/com/holiday
    private String m_URL_COM_GOODS_TYPE;//主要品名 http://mdd.bondex.com.cn:9085/maindata/api/com/goodsType
    private String m_URL_COM_CONTAINER_TYPE;//箱型 http://mdd.bondex.com.cn:9085/maindata/api/com/containerType
    private String m_URL_COM_DANGEROUS_GOODS;//危险品 http://mdd.bondex.com.cn:9085/maindata/api/com/dangerousGoods
    private String m_URL_COM_CUSTOMER_ADDRESS_PERSONAL;//个性化地址 http://mdd.bondex.com.cn:9085/maindata/api/com/customerAddressPersonal
    private String m_URL_COM_PRODUCT_TYPE;//产品类型 http://mdd.bondex.com.cn:9085/maindata/api/com/productType
    private String m_URL_COM_PACKAGE;//包装 http://mdd.bondex.com.cn:9085/maindata/api/com/package
    private String m_URL_COM_RELATION_BUSINESS_TYPE_SERVICE;//服务类型-业务类型  http://mdd.bondex.com.cn:9085/maindata/api/com/relationBusinessTypeService
    private String m_URL_COM_RELATION_SERVICE_SERVICE;//服务项  http://mdd.bondex.com.cn:9085/maindata/api/com/relationServiceService
    private String m_URL_COM_RELATION_BUSINESS_TYPE_PRODUCT;//产品类型  http://mdd.bondex.com.cn:9085/maindata/api/com/relationBusinessTypeProduct

    private String m_URL_SEA_PORT;//海运港口  http://mdd.bondex.com.cn:9085/maindata/api/sea/port
    private String m_URL_SEA_WHARF;//海运码头  http://mdd.bondex.com.cn:9085/maindata/api/sea/wharf
    private String m_URL_SEA_BUSINESS_NATURE;//业务性质  http://mdd.bondex.com.cn:9085/maindata/api/sea/businessNature
    private String m_URL_SEA_FREIGHT_CLAUSE;//运费条款  http://mdd.bondex.com.cn:9085/maindata/api/sea/freightClause
    private String m_URL_SEA_DELIVERY_METHOD;//交货方式  http://mdd.bondex.com.cn:9085/maindata/api/sea/deliveryMethod
    private String m_URL_SEA_SIGNING_TYPE;//签单类型  http://mdd.bondex.com.cn:9085/maindata/api/sea/signingType
    private String m_URL_SEA_SETTLEMENT_METHOD;//结算方式  http://mdd.bondex.com.cn:9085/maindata/api/sea/settlementMethod
    private String m_URL_SEA_TRADE_LANE;//海运航线  http://mdd.bondex.com.cn:9085/maindata/api/sea/tradeLane
    private String m_URL_SEA_CARRIER_LINE;//船公司航线  http://mdd.bondex.com.cn:9085/maindata/api/sea/carrierLine
    private String m_URL_SEA_VESSEL;//船名  http://mdd.bondex.com.cn:9085/maindata/api/sea/vessel
    private String m_URL_SEA_VOYAGE;//船期表  http://mdd.bondex.com.cn:9085/maindata/api/sea/voyage
    private String m_URL_SEA_BUSINESS_TYPE;//业务类型  http://mdd.bondex.com.cn:9085/maindata/api/sea/businessType

    private String m_URL_CUSTOMS_CUSTOMS;//关区 http://mdd.bondex.com.cn:9085/maindata/api/customs/customs
    private String m_URL_CUSTOMS_DOCKLAND;//港区 http://mdd.bondex.com.cn:9085/maindata/api/customs/dockland
    private String m_URL_CUSTOMS_OUT_DATA;//捷报数据 http://mdd.bondex.com.cn:9085/maindata/api/customs/outData

    private String m_URL_SETTLE_CURRENCY;//结算币制 http://mdd.bondex.com.cn:9085/maindata/api/settle/currency
    private String m_URL_SETTLE_FEE_CATEGORY;//费用分类 http://mdd.bondex.com.cn:9085/maindata/api/settle/feeCategory

    private void resetURL() {
        this.m_URL_COM_DICTIONARY = m_URL + "/api/com/dictionary";
        this.m_URL_COM_COUNTRY = m_URL + "/api/com/country";
        this.m_URL_COM_CN_DISTRICT = m_URL + "/api/com/cnDistrict";
        this.m_URL_COM_FN_DISTRICT = m_URL + "/api/com/fnDistrict";
        this.m_URL_COM_HOLIDAY = m_URL + "/api/com/holiday";
        this.m_URL_COM_GOODS_TYPE = m_URL + "/api/com/goodsType";
        this.m_URL_COM_CONTAINER_TYPE = m_URL + "/api/com/containerType";
        this.m_URL_COM_DANGEROUS_GOODS = m_URL + "/api/com/dangerousGoods";
        this.m_URL_COM_CUSTOMER_ADDRESS_PERSONAL = m_URL + "/api/com/customerAddressPersonal";
        this.m_URL_COM_PRODUCT_TYPE = m_URL + "/api/com/productType";
        this.m_URL_COM_PACKAGE = m_URL + "/api/com/package";
        this.m_URL_COM_RELATION_BUSINESS_TYPE_SERVICE = m_URL + "/api/com/relationBusinessTypeService";
        this.m_URL_COM_RELATION_SERVICE_SERVICE = m_URL + "/api/com/relationServiceService";
        this.m_URL_COM_RELATION_BUSINESS_TYPE_PRODUCT = m_URL + "/api/com/relationBusinessTypeProduct";

        this.m_URL_SEA_PORT = m_URL + "/api/sea/port";
        this.m_URL_SEA_WHARF = m_URL + "/api/sea/wharf";
        this.m_URL_SEA_BUSINESS_NATURE = m_URL + "/api/sea/businessNature";
        this.m_URL_SEA_FREIGHT_CLAUSE = m_URL + "/api/sea/freightClause";
        this.m_URL_SEA_DELIVERY_METHOD = m_URL + "/api/sea/deliveryMethod";
        this.m_URL_SEA_SIGNING_TYPE = m_URL + "/api/sea/signingType";
        this.m_URL_SEA_SETTLEMENT_METHOD = m_URL + "/api/sea/settlementMethod";
        this.m_URL_SEA_TRADE_LANE = m_URL + "/api/sea/tradeLane";
        this.m_URL_SEA_CARRIER_LINE = m_URL + "/api/sea/carrierLine";
        this.m_URL_SEA_VESSEL = m_URL + "/api/sea/vessel";
        this.m_URL_SEA_VOYAGE = m_URL + "/api/sea/voyage";
        this.m_URL_SEA_BUSINESS_TYPE = m_URL + "/api/sea/businessType";

        this.m_URL_CUSTOMS_CUSTOMS = m_URL + "/api/customs/customs";
        this.m_URL_CUSTOMS_DOCKLAND = m_URL + "/api/customs/dockland";
        this.m_URL_CUSTOMS_OUT_DATA = m_URL + "/api/customs/outData";

        this.m_URL_SETTLE_CURRENCY = m_URL + "/api/settle/currency";
        this.m_URL_SETTLE_FEE_CATEGORY = m_URL + "/api/settle/feeCategory";
    }

    private String frameworkAppID;
    private String frameworkAppName;
    private Integer limitMax = 50;

    //操作类型
    public final static String ACTION_QUERY = "query";
    public final static String ACTION_ADD = "add";

    //审核状态
    public final static String DATA_TYPE_TEMP = "temp";
    public final static String DATA_TYPE_AUDIT_PASS = "auditPass";

    public String getFrameworkAppID() {
        return frameworkAppID;
    }

    public void setFrameworkAppID(String frameworkAppID) {
        this.frameworkAppID = frameworkAppID;
    }

    public String getFrameworkAppName() {
        return frameworkAppName;
    }

    public void setFrameworkAppName(String frameworkAppName) {
        this.frameworkAppName = frameworkAppName;
    }

    public Integer getLimitMax() {
        return limitMax;
    }

    public void setLimitMax(Integer limitMax) {
        this.limitMax = limitMax;
    }

    /**
     * 拼接头信息
     */
    private TransmissionHead getHead(String sAction) {
        TransmissionHead oHead = new TransmissionHead();
        oHead.setSeqNo(UUID.randomUUID().toString());
        oHead.setSenderID(this.frameworkAppID);
        oHead.setSenderName(this.frameworkAppName);
        oHead.setReceiverID("40");
        oHead.setReceiverName("基础数据");
        oHead.setDocTypeID("");
        oHead.setDocTypeName("");
        oHead.setCreateTime(DateUtil.getNowTime());
        oHead.setFinishTime("");
        oHead.setDataInterfaceID("");
        oHead.setDataInterfaceName("");
        oHead.setVersion("1.0");
        oHead.setAction(sAction);
        return oHead;
    }

    //endregion

    //region 普通数据

    // region公共字典

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComDictionaryVO>> getComDictionary(BaseComDictionaryDTO dto) throws Exception {
        TransmissionModel<BaseComDictionaryDTO> oParam = new TransmissionModel<>();
        JsonDataT<List<BaseComDictionaryVO>> jsonDataT = new JsonDataT<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);
        String sParam = JacksonUtil.writeValue(oParam);
        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_DICTIONARY, sParam);
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComDictionaryVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComDictionaryVO>> getComDictionaryForAutocomplete(String sToken, String sLikeStr, String type) throws Exception {
        BaseComDictionaryDTO dto = new BaseComDictionaryDTO();
        dto.setToken(sToken);
        dto.setType(type);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");
        return getComDictionary(dto);
    }

    //endregion

    //region 国家

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComCountryVO>> getComCountry(BaseComCountryDTO oParamMain) throws Exception {
        TransmissionModel<BaseComCountryDTO> oParam = new TransmissionModel<>();
        JsonDataT<List<BaseComCountryVO>> jsonDataT = new JsonDataT<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);
        String sParam = JacksonUtil.writeValue(oParam);
        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_COUNTRY, sParam);
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComCountryVO.class));
        }

        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComCountryVO>> getComCountryForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseComCountryDTO oParamMain = new BaseComCountryDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getComCountry(oParamMain);
    }

    //endregion

    //region 省市区

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComCnDistrictVO>> getComCnDistrict(BaseComCnDistrictDTO oParamMain) throws Exception {
        TransmissionModel<BaseComCnDistrictDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);
        String sParam = JacksonUtil.writeValue(oParam);
        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_CN_DISTRICT, sParam);
        JsonDataT<List<BaseComCnDistrictVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComCnDistrictVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComCnDistrictVO>> getComCnDistrictForAutocomplete(String sToken, String sCountryCode, String sProvinceCode, String sCityCode, String sLikeStr) throws Exception {
        BaseComCnDistrictDTO oParamMain = new BaseComCnDistrictDTO();
        oParamMain.setToken(sToken);
        oParamMain.setCountryCode(sCountryCode);
        oParamMain.setProvinceCode(sProvinceCode);
        oParamMain.setCityCode(sCityCode);

        boolean bCountry = StringUtils.isNotEmpty(sCountryCode);
        boolean bProvince = StringUtils.isNotEmpty(sProvinceCode);
        boolean bCity = StringUtils.isNotEmpty(sCityCode);
        if (bCountry && !bProvince && !bCity) {
            oParamMain.setDistrictType((byte) 2);
        } else if (bCountry && bProvince && !bCity) {
            oParamMain.setDistrictType((byte) 3);
        } else if (bCountry && bProvince && bCity) {
            oParamMain.setDistrictType((byte) 4);
        }

        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(this.limitMax);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getComCnDistrict(oParamMain);
    }

    //endregion

    //region 外国省市区

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComFnDistrictVO>> getComFnDistrict(BaseComFnDistrictDTO oParamMain) throws Exception {
        TransmissionModel<BaseComFnDistrictDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_FN_DISTRICT, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        JsonDataT<List<BaseComFnDistrictVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComFnDistrictVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComFnDistrictVO>> getComFnDistrictForAutocomplete(String sToken, String sCountryCode, String sProvinceCode, String sCityCode, String sLikeStr) throws Exception {
        BaseComFnDistrictDTO oParamMain = new BaseComFnDistrictDTO();
        oParamMain.setToken(sToken);
        oParamMain.setCountryCode(sCountryCode);
        oParamMain.setProvinceCode(sProvinceCode);
        oParamMain.setCityCode(sCityCode);

        boolean bCountry = StringUtils.isNotEmpty(sCountryCode);
        boolean bProvince = StringUtils.isNotEmpty(sProvinceCode);
        boolean bCity = StringUtils.isNotEmpty(sCityCode);
        if (bCountry && !bProvince && !bCity) {
            oParamMain.setDistrictType((byte) 2);
        } else if (bCountry && bProvince && !bCity) {
            oParamMain.setDistrictType((byte) 3);
        } else if (bCountry && bProvince && bCity) {
            oParamMain.setDistrictType((byte) 4);
        }

        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(this.limitMax);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getComFnDistrict(oParamMain);
    }

    //endregion

    //region 假日

    /**
     * 取得列表
     */
//	@Deprecated
//	public JsonDataT<List<BaseComHolidayVO>> getComHoliday(BaseComHolidayDTO oParamMain) throws Exception {
//		TransmissionModel<BaseComHolidayDTO> oParam = new TransmissionModel<>();
//		oParam.setHead(getHead(ACTION_QUERY));
//		oParam.setMain(oParamMain);
//
//		String sParam = JacksonUtil.writeValue(oParam);
//
//
//		String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_HOLIDAY, sParam);
//		if (StringUtils.isNotEmpty(sResult)) {
//			JsonDataT<List<BaseComHolidayVO>> oData = JacksonUtil.readValue(sResult, new TypeReference<JsonDataT<List<BaseComHolidayVO>>>() {
//			});
//			if (oData != null) {
//				return oData;
//			}
//		}
//		return null;
//	}

    /**
     * 取得列表 页面下拉
     */
//	@Deprecated
//	public JsonDataT<List<BaseComHolidayVO>> getComHolidayForAutocomplete(String sToken, String sLikeStr) throws Exception {
//		BaseComHolidayDTO oParamMain = new BaseComHolidayDTO();
//		oParamMain.setToken(sToken);
//		oParamMain.setLikeStr(sLikeStr);
//		oParamMain.setLimit(this.limitMax);
//		oParamMain.setPageNumber(1);
//		oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
//		oParamMain.setDelFlg("0");
//
//		return getComHoliday(oParamMain);
//	}

    //endregion

    //region 商品大类

    /**
     * 取得列表
     */
//	public JsonDataT<List<BaseComGoodsTypeVO>> getComGoodsType(BaseComGoodsTypeDTO dto) throws Exception {
//		TransmissionModel<BaseComGoodsTypeDTO> oParam = new TransmissionModel<>();
//		oParam.setHead(getHead(ACTION_QUERY));
//		oParam.setMain(dto);
//
//		String sParam = JacksonUtil.writeValue(oParam);
//
//		//(GlobalConst.EMPTY, "getComMainProductName", "主要品名-开始", GlobalConst.EMPTY, sParam, null);
//		long startTime = System.currentTimeMillis();
//
//		String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_GOODS_TYPE, sParam);
//
//		long useTime = System.currentTimeMillis() - startTime;
//		//(GlobalConst.EMPTY, "getComMainProductName", String.format("主要品名-结束(%s)", useTime + "ms"), sResult, sParam, null);
//
//		if (StringUtils.isNotEmpty(sResult)) {
//			JsonDataT<List<BaseComGoodsTypeVO>> oData = JacksonUtil.readValue(sResult, new TypeReference<JsonDataT<List<BaseComGoodsTypeVO>>>() {
//			});
//			if (oData != null) {
//				return oData;
//			}
//		}
//		return null;
//	}

    /**
     //	 * 取得列表 页面下拉
     //	 */
//	public JsonDataT<List<BaseComGoodsTypeVO>> getComGoodsTypeForAutocomplete(String sToken, String sLikeStr) throws Exception {
//		BaseComGoodsTypeDTO dto = new BaseComGoodsTypeDTO();
//		dto.setToken(sToken);
//		dto.setLikeStr(sLikeStr);
//		dto.setLimit(10);
//		dto.setPageNumber(1);
//		dto.setDataType(DATA_TYPE_AUDIT_PASS);
//		dto.setDelFlg("0");
//		return getComGoodsType(dto);
//	}

    //endregion

    //region 箱型

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComContainerTypeVO>> getComContainerType(BaseComContainerTypeDTO dto) throws Exception {
        TransmissionModel<BaseComContainerTypeDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        JSONObject jsonObject = JSONObject.parseObject(HttpConnectUtil.doHttpPost(m_URL_COM_CONTAINER_TYPE, sParam));
        JsonDataT<List<BaseComContainerTypeVO>> jsonDataT = new JsonDataT<>();
        if (null != jsonObject) {
            if( "true".equals(jsonObject.getString("success"))){
                String data = jsonObject.getString("data");
                if (StringUtils.isNotEmpty(data)) {
                    jsonDataT.setData(JSON.parseArray(data, BaseComContainerTypeVO.class));
                }
                jsonDataT.setSuccess(Boolean.TRUE);
            }else {
                jsonDataT.setSuccess(Boolean.FALSE);
                jsonDataT.setMsg(jsonObject.getString("msg"));
            }
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComContainerTypeVO>> getComContainerTypeForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseComContainerTypeDTO dto = new BaseComContainerTypeDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");

        return getComContainerType(dto);
    }

    //endregion

    //region 危险品

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComDangerousGoodsVO>> getComDangerousGoods(BaseComDangerousGoodsDTO dto) throws Exception {
        TransmissionModel<BaseComDangerousGoodsDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getComDangerousGoods", "危险品-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_DANGEROUS_GOODS, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getComDangerousGoods", String.format("危险品-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseComDangerousGoodsVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComDangerousGoodsVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComDangerousGoodsVO>> getComDangerousGoodsForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseComDangerousGoodsDTO dto = new BaseComDangerousGoodsDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");

        return getComDangerousGoods(dto);
    }

    //endregion

    //region 个性化地址

    /**
     * 添加个性化地址
     */
//    public JsonData addComCustomerAddressPersonal(BaseComCustomerAddressPersonalDTO dto) throws Exception {
//        JsonData oData = new JsonData();
//        TransmissionModel<BaseComCustomerAddressPersonalDTO> oParam = new TransmissionModel<>();
//        oParam.setHead(getHead(ACTION_ADD));
//        oParam.setMain(dto);
//
//        String sParam = JacksonUtil.writeValue(oParam);
//
//        //(GlobalConst.EMPTY, "addComCustomerAddressPersonal", "添加个性化地址-开始", GlobalConst.EMPTY, sParam, null);
//        long startTime = System.currentTimeMillis();
//
//        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_CUSTOMER_ADDRESS_PERSONAL, sParam);
//
//        long useTime = System.currentTimeMillis() - startTime;
//        //(GlobalConst.EMPTY, "addComCustomerAddressPersonal", String.format("添加个性化地址-结束(%s)", useTime + "ms"), sResult, sParam, null);
//
//        if (StringUtils.isNotEmpty(sResult)) {
//            oData = JacksonUtil.readValue(sResult, JsonData.class);
//        }
//        return oData;
//    }

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComCustomerAddressPersonalVO>> getComCustomerAddressPersonal(BaseComCustomerAddressPersonalDTO dto) throws Exception {
        TransmissionModel<BaseComCustomerAddressPersonalDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getComCustomerAddressPersonal", "个性化地址-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_CUSTOMER_ADDRESS_PERSONAL, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getComCustomerAddressPersonal", String.format("个性化地址-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseComCustomerAddressPersonalVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComCustomerAddressPersonalVO.class));
        }
        return jsonDataT;
    }


    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComCustomerAddressPersonalVO>> getComCustomerAddressPersonalForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseComCustomerAddressPersonalDTO dto = new BaseComCustomerAddressPersonalDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg(GlobalConst.ZERO);

        return getComCustomerAddressPersonal(dto);
    }

    //endregion

    //region 产品类型

    /**
     * 取得列表
     */
//	public JsonDataT<List<BaseComProductTypeVO>> getComProductType(BaseComProductTypeDTO dto) throws Exception {
//		TransmissionModel<BaseComProductTypeDTO> oParam = new TransmissionModel<>();
//		oParam.setHead(getHead(ACTION_QUERY));
//		oParam.setMain(dto);
//
//		String sParam = JacksonUtil.writeValue(oParam);
//
//		//(GlobalConst.EMPTY, "getComProductType", "产品类型-开始", GlobalConst.EMPTY, sParam, null);
//		long startTime = System.currentTimeMillis();
//
//		String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_PRODUCT_TYPE, sParam);
//
//		long useTime = System.currentTimeMillis() - startTime;
//		//(GlobalConst.EMPTY, "getComProductType", String.format("产品类型-结束(%s)", useTime + "ms"), sResult, sParam, null);
//
//		if (StringUtils.isNotEmpty(sResult)) {
//			JsonDataT<List<BaseComProductTypeVO>> oData = JacksonUtil.readValue(sResult, new TypeReference<JsonDataT<List<BaseComProductTypeVO>>>() {
//			});
//			if (oData != null) {
//				return oData;
//			}
//		}
//		return null;
//	}
//
//
//	/**
//	 * 取得列表 页面下拉
//	 */
//	public JsonDataT<List<BaseComProductTypeVO>> getComProductTypeForAutocomplete(String sToken, String sLikeStr) throws Exception {
//		BaseComProductTypeDTO dto = new BaseComProductTypeDTO();
//		dto.setToken(sToken);
//		dto.setLikeStr(sLikeStr);
//		dto.setLimit(10);
//		dto.setPageNumber(1);
//		dto.setDataType(DATA_TYPE_AUDIT_PASS);
//		dto.setDelFlg(GlobalConst.ZERO);
//
//		return getComProductType(dto);
//	}

    //endregion

    //region 包装

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComPackageVO>> getComPackage(BaseComPackageDTO dto) throws Exception {
        TransmissionModel<BaseComPackageDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);
        String sParam = JacksonUtil.writeValue(oParam);
        JSONObject jsonObject = JSONObject.parseObject(HttpConnectUtil.doHttpPost(m_URL_COM_PACKAGE, sParam));
        JsonDataT<List<BaseComPackageVO>> jsonDataT = new JsonDataT<>();
        if (null != jsonObject) {
            if( "true".equals(jsonObject.getString("success"))){
                String data = jsonObject.getString("data");
                if (StringUtils.isNotEmpty(data)) {
                    jsonDataT.setData(JSON.parseArray(data, BaseComPackageVO.class));
                }
                jsonDataT.setSuccess(Boolean.TRUE);
            }else {
                jsonDataT.setSuccess(Boolean.FALSE);
                jsonDataT.setMsg(jsonObject.getString("msg"));
            }
        }
        return jsonDataT;
    }


    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComPackageVO>> getComPackageForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseComPackageDTO dto = new BaseComPackageDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg(GlobalConst.ZERO);

        return getComPackage(dto);
    }

    //endregion

    //region 服务类型（服务类型与业务类型）

    /**
     * 取得列表
     */
//	public JsonDataT<List<BaseComRelationBusinessTypeServiceVO>> getComBusinessTypeService(BaseComRelationBusinessTypeServiceDTO dto) throws Exception {
//		TransmissionModel<BaseComRelationBusinessTypeServiceDTO> oParam = new TransmissionModel<>();
//		oParam.setHead(getHead(ACTION_QUERY));
//		oParam.setMain(dto);
//
//		String sParam = JacksonUtil.writeValue(oParam);
//
//		//(GlobalConst.EMPTY, "getComBusinessTypeService", "服务类型-业务类型-开始", GlobalConst.EMPTY, sParam, null);
//		long startTime = System.currentTimeMillis();
//
//		String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_RELATION_BUSINESS_TYPE_SERVICE, sParam);
//
//		long useTime = System.currentTimeMillis() - startTime;
//		//(GlobalConst.EMPTY, "getComBusinessTypeService", String.format("服务类型-业务类型-结束(%s)", useTime + "ms"), sResult, sParam, null);
//
//		if (StringUtils.isNotEmpty(sResult)) {
//			JsonDataT<List<BaseComRelationBusinessTypeServiceVO>> oData = JacksonUtil.readValue(sResult, new TypeReference<JsonDataT<List<BaseComRelationBusinessTypeServiceVO>>>() {
//			});
//			if (oData != null) {
//				return oData;
//			}
//		}
//		return null;
//	}

//	/**
//	 * 取得列表 页面下拉
//	 */
//	public JsonDataT<List<BaseComRelationBusinessTypeServiceVO>> getComBusinessTypeServiceForAutocomplete(String sToken, String sBusinessTypeCode) throws Exception {
//		BaseComRelationBusinessTypeServiceDTO dto = new BaseComRelationBusinessTypeServiceDTO();
//		dto.setToken(sToken);
//		dto.setBusinessTypeCode(sBusinessTypeCode);
//		dto.setLimit(100);
//		dto.setPageNumber(1);
//		dto.setDataType(DATA_TYPE_AUDIT_PASS);
//		dto.setDelFlg(GlobalConst.ZERO);
//
//		return getComBusinessTypeService(dto);
//	}
    //endregion

    //region 服务项（服务与子服务）

//	/**
//	 * 取得列表
//	 */
//	public JsonDataT<List<BaseComRelationServiceServiceVO>> getComRelationServiceService(BaseComRelationServiceServiceDTO dto) throws Exception {
//		TransmissionModel<BaseComRelationServiceServiceDTO> oParam = new TransmissionModel<>();
//		oParam.setHead(getHead(ACTION_QUERY));
//		oParam.setMain(dto);
//
//		String sParam = JacksonUtil.writeValue(oParam);
//
//		//(GlobalConst.EMPTY, "getComRelationServiceService", "服务项-开始", GlobalConst.EMPTY, sParam, null);
//		long startTime = System.currentTimeMillis();
//
//		String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_RELATION_SERVICE_SERVICE, sParam);
//
//		long useTime = System.currentTimeMillis() - startTime;
//		//(GlobalConst.EMPTY, "getComRelationServiceService", String.format("服务项-结束(%s)", useTime + "ms"), sResult, sParam, null);
//
//		if (StringUtils.isNotEmpty(sResult)) {
//			JsonDataT<List<BaseComRelationServiceServiceVO>> oData = JacksonUtil.readValue(sResult, new TypeReference<JsonDataT<List<BaseComRelationServiceServiceVO>>>() {
//			});
//			if (oData != null) {
//				return oData;
//			}
//		}
//		return null;
//	}
//
//	/**
//	 * 取得列表 页面下拉
//	 */
//	public JsonDataT<List<BaseComRelationServiceServiceVO>> getComRelationServiceServiceForAutocomplete(String sToken, String sServiceCode) throws Exception {
//		BaseComRelationServiceServiceDTO dto = new BaseComRelationServiceServiceDTO();
//		dto.setToken(sToken);
//		dto.setServiceCode(sServiceCode);
//		dto.setLimit(100);
//		dto.setPageNumber(1);
//		dto.setDataType(DATA_TYPE_AUDIT_PASS);
//		dto.setDelFlg(GlobalConst.ZERO);
//
//		return getComRelationServiceService(dto);
//	}
    //endregion

    // region 产品类型（产品类型与业务类型）

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseComRelationBusinessTypeProductVO>> getComRelationBusinessTypeProduct(BaseComRelationBusinessTypeProductDTO dto) throws Exception {
        TransmissionModel<BaseComRelationBusinessTypeProductDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getComRelationBusinessTypeProduct", "产品类型（产品类型与业务类型）-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_COM_RELATION_BUSINESS_TYPE_PRODUCT, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getComRelationBusinessTypeProduct", String.format("产品类型（产品类型与业务类型）-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseComRelationBusinessTypeProductVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseComRelationBusinessTypeProductVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseComRelationBusinessTypeProductVO>> getComRelationBusinessTypeProductForAutocomplete(String sToken, String sBusinessTypeCode) throws Exception {
        BaseComRelationBusinessTypeProductDTO dto = new BaseComRelationBusinessTypeProductDTO();
        dto.setToken(sToken);
        dto.setBusinessTypeCode(sBusinessTypeCode);
        dto.setLimit(100);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg(GlobalConst.ZERO);

        return getComRelationBusinessTypeProduct(dto);
    }
    //endregion

    //endregion

    //region 海运数据

    //region 港口

    /**
     * 取得港口列表
     */
    public JsonDataT<List<BaseSeaPortVO>> getSeaPort(BaseSeaPortDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaPortDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);
        JSONObject jsonObject = JSONObject.parseObject(HttpConnectUtil.doHttpPost(m_URL_SEA_PORT, sParam));
        JsonDataT<List<BaseSeaPortVO>> jsonDataT = new JsonDataT<>();
        if (null != jsonObject) {
            if( "true".equals(jsonObject.getString("success"))){
                String data = jsonObject.getString("data");
                if (StringUtils.isNotEmpty(data)) {
                    jsonDataT.setData(JSON.parseArray(data, BaseSeaPortVO.class));
                }
                jsonDataT.setSuccess(Boolean.TRUE);
            }else {
                jsonDataT.setSuccess(Boolean.FALSE);
                jsonDataT.setMsg(jsonObject.getString("msg"));
            }
        }
        return jsonDataT;
    }

    /**
     * 取得港口列表 页面下拉
     */
    public JsonDataT<List<BaseSeaPortVO>> getSeaPortForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaPortDTO oParamMain = new BaseSeaPortDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaPort(oParamMain);
    }

    /**
     * 取得港口列表 根据CODE查找
     */
    public BaseSeaPortVO getSeaPortByCode(String sToken, String sCode) throws Exception {
        BaseSeaPortDTO oParamMain = new BaseSeaPortDTO();
        oParamMain.setToken(sToken);
        oParamMain.setCode(sCode);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        JsonDataT<List<BaseSeaPortVO>> oResponse = getSeaPort(oParamMain);
        if (oResponse != null && oResponse.getData() != null && oResponse.getData().size() > 0) {
            for (BaseSeaPortVO o : oResponse.getData()) {
                if (sCode.equalsIgnoreCase(o.getCode())) {
                    return o;
                }
            }
        }
        return null;
    }

    //endregion

    //region 码头

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaWharfVO>> getSeaWharf(BaseSeaWharfDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaWharfDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaWharf", "码头-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_WHARF, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaWharf", String.format("码头-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaWharfVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaWharfVO.class));
        }
        return jsonDataT;
    }

    /**
     * 页面下拉
     */
    public JsonDataT<List<BaseSeaWharfVO>> getSeaWharfForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaWharfDTO oParamMain = new BaseSeaWharfDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaWharf(oParamMain);
    }

    //endregion

    //region 业务性质

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaBusinessNatureVO>> getSeaBusinessNature(BaseSeaBusinessNatureDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaBusinessNatureDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaBusinessNature", "业务性质-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_BUSINESS_NATURE, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaBusinessNature", String.format("业务性质-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaBusinessNatureVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaBusinessNatureVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaBusinessNatureVO>> getSeaBusinessNatureForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaBusinessNatureDTO oParamMain = new BaseSeaBusinessNatureDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaBusinessNature(oParamMain);
    }

    //endregion

    //region 运费条款

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaFreightClauseVO>> getSeaFreightClause(BaseSeaFreightClauseDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaFreightClauseDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);
        JSONObject jsonObject = JSONObject.parseObject(HttpConnectUtil.doHttpPost(m_URL_SEA_FREIGHT_CLAUSE, sParam));
        JsonDataT<List<BaseSeaFreightClauseVO>> jsonDataT = new JsonDataT<>();
        if (null != jsonObject) {
            if( "true".equals(jsonObject.getString("success"))){
                String data = jsonObject.getString("data");
                if (StringUtils.isNotEmpty(data)) {
                    jsonDataT.setData(JSON.parseArray(data, BaseSeaFreightClauseVO.class));
                }
                jsonDataT.setSuccess(Boolean.TRUE);
            }else {
                jsonDataT.setSuccess(Boolean.FALSE);
                jsonDataT.setMsg(jsonObject.getString("msg"));
            }
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaFreightClauseVO>> getSeaFreightClauseForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaFreightClauseDTO oParamMain = new BaseSeaFreightClauseDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaFreightClause(oParamMain);
    }

    //endregion

    //region 交货方式

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaDeliveryMethodVO>> getSeaDeliveryMethod(BaseSeaDeliveryMethodDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaDeliveryMethodDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);
        JSONObject jsonObject = JSONObject.parseObject(HttpConnectUtil.doHttpPost(m_URL_SEA_DELIVERY_METHOD, sParam));
        JsonDataT<List<BaseSeaDeliveryMethodVO>> jsonDataT = new JsonDataT<>();
        if (null != jsonObject) {
            if( "true".equals(jsonObject.getString("success"))){
                String data = jsonObject.getString("data");
                if (StringUtils.isNotEmpty(data)) {
                    jsonDataT.setData(JSON.parseArray(data, BaseSeaDeliveryMethodVO.class));
                }
                jsonDataT.setSuccess(Boolean.TRUE);
            }else {
                jsonDataT.setSuccess(Boolean.FALSE);
                jsonDataT.setMsg(jsonObject.getString("msg"));
            }
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaDeliveryMethodVO>> getSeaDeliveryMethodForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaDeliveryMethodDTO oParamMain = new BaseSeaDeliveryMethodDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaDeliveryMethod(oParamMain);
    }

    //endregion

    //region 签单类型

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaSigningTypeVO>> getSeaSigningType(BaseSeaSigningTypeDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaSigningTypeDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaSigningType", "签单类型-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_SIGNING_TYPE, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaSigningType", String.format("签单类型-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaSigningTypeVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaSigningTypeVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaSigningTypeVO>> getSeaSigningTypeForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaSigningTypeDTO oParamMain = new BaseSeaSigningTypeDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaSigningType(oParamMain);
    }

    //endregion

    //region 结算方式

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaSettlementMethodVO>> getSeaSettlementMethod(BaseSeaSettlementMethodDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaSettlementMethodDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaSettlementMethod", "结算方式-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_SETTLEMENT_METHOD, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaSettlementMethod", String.format("结算方式-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaSettlementMethodVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaSettlementMethodVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaSettlementMethodVO>> getSeaSettlementMethodForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaSettlementMethodDTO oParamMain = new BaseSeaSettlementMethodDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaSettlementMethod(oParamMain);
    }

    //endregion

    //region 海运航线

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaTradeLaneVO>> getSeaTradeLane(BaseSeaTradeLaneDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaTradeLaneDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaTradeLane", "海运航线-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_TRADE_LANE, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaTradeLane", String.format("海运航线-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaTradeLaneVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaTradeLaneVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaTradeLaneVO>> getSeaTradeLaneForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaTradeLaneDTO oParamMain = new BaseSeaTradeLaneDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaTradeLane(oParamMain);
    }

    //endregion

    //region 船公司航线

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaCarrierLineVO>> getSeaCarrierLine(BaseSeaCarrierLineDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaCarrierLineDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaCarrierLine", "船公司航线-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_CARRIER_LINE, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaCarrierLine", String.format("船公司航线-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaCarrierLineVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaCarrierLineVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaCarrierLineVO>> getSeaCarrierLineForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaCarrierLineDTO oParamMain = new BaseSeaCarrierLineDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaCarrierLine(oParamMain);
    }

    //endregion

    //region 船名

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaVesselVO>> getSeaVessel(BaseSeaVesselDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaVesselDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaVessel", "船名-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_VESSEL, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaVessel", String.format("船名-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaVesselVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaVesselVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaVesselVO>> getSeaVesselForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaVesselDTO oParamMain = new BaseSeaVesselDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaVessel(oParamMain);
    }

    //endregion

    //region 航次 -船期表

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaVoyageVO>> getSeaVoyage(BaseSeaVoyageDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaVoyageDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaVoyage", "航次-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_VOYAGE, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaVoyage", String.format("航次-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaVoyageVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaVoyageVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaVoyageVO>> getSeaVoyageForAutocomplete(String sToken, String sLikeStr, String sType) throws Exception {
        BaseSeaVoyageDTO oParamMain = new BaseSeaVoyageDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setQueryMode(sType);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaVoyage(oParamMain);
    }

    //endregion

    //region 业务类型

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSeaBusinessTypeVO>> getSeaBusinessType(BaseSeaBusinessTypeDTO oParamMain) throws Exception {
        TransmissionModel<BaseSeaBusinessTypeDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(oParamMain);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSeaBusinessType", "业务类型", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SEA_BUSINESS_TYPE, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSeaBusinessType", String.format("业务类型-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSeaBusinessTypeVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSeaBusinessTypeVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSeaBusinessTypeVO>> getSeaBusinessTypeForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSeaBusinessTypeDTO oParamMain = new BaseSeaBusinessTypeDTO();
        oParamMain.setToken(sToken);
        oParamMain.setLikeStr(sLikeStr);
        oParamMain.setLimit(10);
        oParamMain.setPageNumber(1);
        oParamMain.setDataType(DATA_TYPE_AUDIT_PASS);
        oParamMain.setDelFlg("0");

        return getSeaBusinessType(oParamMain);
    }

    //endregion

    //endregion

    //region 关务数据

    //region 关区

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseCustomsCustomsVO>> getCustomsCustoms(BaseCustomsCustomsDTO dto) throws Exception {
        TransmissionModel<BaseCustomsCustomsDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getCustomsCustoms", "关区-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_CUSTOMS_CUSTOMS, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getCustomsCustoms", String.format("关区-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseCustomsCustomsVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseCustomsCustomsVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseCustomsCustomsVO>> getCustomsCustomsForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseCustomsCustomsDTO dto = new BaseCustomsCustomsDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");
        return getCustomsCustoms(dto);
    }

    //endregion

    //region 港区

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseCustomsDocklandVO>> getCustomsDockland(BaseCustomsDocklandDTO dto) throws Exception {
        TransmissionModel<BaseCustomsDocklandDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getCustomsDockland", "港区-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_CUSTOMS_DOCKLAND, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getCustomsDockland", String.format("港区-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseCustomsDocklandVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseCustomsDocklandVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseCustomsDocklandVO>> getCustomsDocklandForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseCustomsDocklandDTO dto = new BaseCustomsDocklandDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");
        return getCustomsDockland(dto);
    }

    //endregion

    //region 捷报数据

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseCustomsOutDataVO>> getCustomsOutData(BaseCustomsOutDataDTO dto) throws Exception {
        TransmissionModel<BaseCustomsOutDataDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getCustomsOutData", "捷报数据-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_CUSTOMS_OUT_DATA, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getCustomsOutData", String.format("捷报数据-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseCustomsOutDataVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseCustomsOutDataVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseCustomsOutDataVO>> getCustomsOutDataForAutocomplete(String sToken, String sLikeStr, String sType) throws Exception {
        BaseCustomsOutDataDTO dto = new BaseCustomsOutDataDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setType(sType);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");
        return getCustomsOutData(dto);
    }

    //endregion

    //endregion

    //region 结算数据

    //region 币种

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSettleCurrencyVO>> getSettleCurrency(BaseSettleCurrencyDTO dto) throws Exception {
        TransmissionModel<BaseSettleCurrencyDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        //(GlobalConst.EMPTY, "getSettleCurrency", "币种-开始", GlobalConst.EMPTY, sParam, null);
        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SETTLE_CURRENCY, sParam);

        long useTime = System.currentTimeMillis() - startTime;
        //(GlobalConst.EMPTY, "getSettleCurrency", String.format("币种-结束(%s)", useTime + "ms"), sResult, sParam, null);

        JsonDataT<List<BaseSettleCurrencyVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSettleCurrencyVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSettleCurrencyVO>> getSettleCurrencyForAutocomplete(String sToken) throws Exception {
        BaseSettleCurrencyDTO dto = new BaseSettleCurrencyDTO();
        dto.setToken(sToken);
        dto.setLimit(10);
        return getSettleCurrency(dto);
    }

    //endregion

    //region 费用分类

    /**
     * 取得列表
     */
    public JsonDataT<List<BaseSettleFeeCategoryVO>> getSettleFeeCategory(BaseSettleFeeCategoryDTO dto) throws Exception {
        TransmissionModel<BaseSettleFeeCategoryDTO> oParam = new TransmissionModel<>();
        oParam.setHead(getHead(ACTION_QUERY));
        oParam.setMain(dto);

        String sParam = JacksonUtil.writeValue(oParam);

        long startTime = System.currentTimeMillis();

        String sResult = HttpConnectUtil.doHttpPost(m_URL_SETTLE_FEE_CATEGORY, sParam);

        long useTime = System.currentTimeMillis() - startTime;

        JsonDataT<List<BaseSettleFeeCategoryVO>> jsonDataT = new JsonDataT<>();
        if (StringUtils.isNotEmpty(sResult)) {
            jsonDataT.setData(JSON.parseArray(sResult, BaseSettleFeeCategoryVO.class));
        }
        return jsonDataT;
    }

    /**
     * 取得列表 页面下拉
     */
    public JsonDataT<List<BaseSettleFeeCategoryVO>> getSettleFeeCategoryForAutocomplete(String sToken, String sLikeStr) throws Exception {
        BaseSettleFeeCategoryDTO dto = new BaseSettleFeeCategoryDTO();
        dto.setToken(sToken);
        dto.setLikeStr(sLikeStr);
        dto.setLimit(10);
        dto.setPageNumber(1);
        dto.setDataType(DATA_TYPE_AUDIT_PASS);
        dto.setDelFlg("0");
        return getSettleFeeCategory(dto);
    }

    //endregion

    //endregion

}
